from django.contrib import admin
from django.urls import path, include, re_path
from datetime import datetime
from apps.base_app.utils import RestfulResponse
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
from apps.base_app.views import pass_active

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('apps.base_app.urls')),
    # YOUR PATTERNS
    path('api/schema/', SpectacularAPIView.as_view(), name='schema'),
    # Optional UI:
    path('api/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),  # swagger接口文档
    path('api/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='redoc'),  # redoc接口文档
    path('/pass_active/', pass_active),
    path('/stage/', lambda x: RestfulResponse(200, {'curr': datetime.now().isocalendar()[1]-40})),
]
